/*
 *  Description: BOAT XU SOFT FHSS
 *  Version: V1.00
 *  Author: boat xu
 *  Email: xifengzui@outlook.com
 *  Date: 2020-07-03 10:40:02
 *  LastEditTime: 2020-07-22 09:41:59
 */ 


#ifndef __bsf_TYPES_H__
#define __bsf_TYPES_H__

#ifndef b_u16_t
    typedef unsigned short int b_u16_t;
#endif

#ifndef b_u8_t
    typedef unsigned char b_u8_t;
#endif

#ifndef b_boolean
typedef enum {
    b_false = 0,
    b_true,
}b_boolean;
#endif

#ifndef b_packSendStat 
typedef enum{
    b_pss_Idel = 0x11,//not in send stat
    b_pss_Busy,//hardware is busy
    b_pss_CompletedAck,// send has completed,the received has been ack
    b_pss_CompletedNoAck,//send has completed,but no ack
}b_pktSendingStat;

typedef enum{
    b_psrs_SendFailed = 0x21,  //the packet sending is failed,
    b_psrs_SendOk,      //the packet sending ok.
}b_pktSendRetStat;

typedef enum{
    b_prs_RecvNone = 0x31,//no packet received
    b_prs_RecvExist,//the packet has arrival
    b_prs_RecvOverflow,//rx buf overload ,you have miss the newer packet.to clearn this state ,you must read the existed buffer.
}b_pktRecvStat;


typedef struct 
{
    b_pktSendRetStat sendResult;
    b_u16_t index;//the index of user define
}bsf_pktSendResult;



#endif

#ifndef b_null
#define b_null 0
#endif


#ifndef bsf_SendPkt_Func
    typedef void (*bsf_SendPkt_Func)(b_u8_t *,b_u8_t);
#endif

#ifndef bsf_GetPkt_Func
    typedef b_u8_t (*bsf_GetPkt_Func)(b_u8_t *,b_u8_t);
#endif

#ifndef bsf_SetFreq_Func
    typedef void (*bsf_SetFreq_Func)(b_u8_t);
#endif

#ifndef bsf_SetCfg_Func
    typedef void (*bsf_SetCfg_Func)(b_u8_t,b_u8_t);
#endif

#ifndef bsf_GetCfg_Func
    typedef b_u8_t (*bsf_GetCfg_Func)(b_u8_t);
#endif

#ifndef bsf_SendingStatus_Func
    typedef b_pktSendingStat (*bsf_SendingStatus_Func)(void);
#endif

#ifndef bsf_IsPktArrival_Func
    typedef b_boolean (*bsf_IsPktArrival_Func)(void);
#endif

#ifndef bsf_GetCurrentTimestamp_Func
    typedef b_u16_t (*bsf_GetCurrentTimestamp_Func)(void);
#endif

#ifndef bsf_PktSendResultEvent_Func
    typedef void (*bsf_PktSendResultEvent)(bsf_pktSendResult *);
#endif

#ifndef bsf_OnConnOkEvent_Func
    typedef void (*bsf_OnConnOkEvent)(void);
#endif

#ifndef bsf_OnConnLostEvent_Func
    typedef void (*bsf_OnConnLostEvent)(void);
#endif

#endif